package com.tsu.mall.common.service.impl;

import com.tsu.mall.common.VO.DetailInfoVo;
import com.tsu.mall.common.entity.BillDetail;
import com.tsu.mall.common.mapper.BillDetailMapper;
import com.tsu.mall.common.service.IBillDetailService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author tttttt
 * @since 2023-04-08
 */
@Service
public class BillDetailServiceImpl extends ServiceImpl<BillDetailMapper, BillDetail> implements IBillDetailService {
    //修改本订单的状态 订单表中 订单详情表中
    @Override
    public void updateStatus(String outTradeNo) {
        baseMapper.updateStatus(outTradeNo);
        Integer billId=baseMapper.doSelectByCode(outTradeNo);
        baseMapper.updateBillDetailStatus(billId);
    }

    @Override
    public List<DetailInfoVo> selectBillDetail(Integer billId) {
        return baseMapper.selectBillDetail(billId);
    }
}
